package OtherPrograms;
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JFrame;
import javax.swing.JPanel;

@SuppressWarnings("serial")
public class drawSnake extends JPanel
{
	
	private Color dGreen = new Color(0, 145,0);
	private int x = 3;
	private int y = 3;
	
	public static void main(String[] args)
	{
		JFrame f = new JFrame();
		f.setSize(100,100);
		f.setLocation(100,100);
		f.setVisible(true);
		f.add(new drawSnake());
		f.validate();
	}
	
	public drawSnake()
	{
		repaint();
	}
	
	public void paintComponent(Graphics g)
	{
		g.setColor(Color.black);
		g.fillRect(0,0,100,100);
		g.setColor(dGreen);
		g.fillRect(x, y + 5, 10, 5);
		g.fillRect(x + 3, y + 2, 4, 2);
		g.fillRect(x + 2, y + 3, 6, 2);
		g.fillRect(x + 1, y + 4, 8, 2);
		g.setColor(Color.black);
		g.fillRect(x + 4, y + 8, 2, 2);
	}
}
